package com.suyafei.code;

import java.util.HashSet;
import java.util.Scanner;

/**
 * @program: code-homework
 * @description
 * @author: luffy
 * @create: 2020-12-30 13:53
 */
public class Homework1 {
    public static void main(String[] args) {
        while (true) {
            Scanner scanner = new Scanner(System.in);
            System.out.println("请输入数字并已','隔开：");
            String arrString = scanner.nextLine();
            int[] arr = parseArr(arrString);

            /**
             * 开始操作
             */
            HashSet set = new HashSet();
            boolean answer = true;
            for (int i = 0; i < arr.length; i++) {
                answer = set.add(arr[i]);
                if (!answer) {
                    System.out.println("No");
                    break;
                }
            }
            if (answer) {
                System.out.println("YES");
            }
        }

    }

    private static int[] parseArr(String arrString) {
        String[] split = arrString.split(",");
        int[] arr = new int[split.length];
        for (int i = 0; i < split.length; i++) {
            int integer = Integer.parseInt(split[i]);
            arr[i] = (int) integer;
        }
        return arr;
    }
}
